package com.ezonsport.android.ui;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

import com.ezonsport.android.R;

public class GoalsSettings extends Activity {
	private ListView m_list ;
	private TextView m_textGoals;
	private TextView m_textGoalsCustom;
	private String list[];
	
	/** Called when the activity is first created. */
    @Override
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.goalsettings);
        
        m_textGoals = (TextView)findViewById(R.id.tx_goals);
        
        m_list = (ListView)findViewById(R.id.list_goals);
        list = getResources().getStringArray(R.array.golas_list);
        ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_list_item_single_choice,
        		list);
        m_list.setAdapter(adapter);
        
        m_textGoalsCustom = (TextView)findViewById(R.id.tx_goals_custom);
        m_textGoalsCustom.setOnClickListener(new OnClickListener(){
        	@Override
        	public void onClick (View v){
        		LayoutInflater factory = LayoutInflater.from(GoalsSettings.this);
                final View textEntryView = factory.inflate(R.layout.alert_dialog_text, null);
                new AlertDialog.Builder(GoalsSettings.this)
                    //.setIcon(R.drawable.alert_dialog_icon)
                    .setTitle(R.string.dialog_title_goals_custom)
                    .setView(textEntryView)
                    .setPositiveButton(R.string.btn_ok, new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int whichButton) {
        
                            /* User clicked OK so do some stuff */
                        	
                        }
                    })
                    .setNegativeButton(R.string.btn_cancel, new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int whichButton) {

                            /* User clicked cancel so do some stuff */
                        	dialog.cancel();
                        }
                    })
                    .create().show();
        	}
        });
        
	}
    
    
}
